<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");

$g4['title'] = "";
//print_r2 ($_SERVER["REQUEST_URI"]);
if (count($_GET)==1 ){
	list($key,$value)=each($_GET);
	if (is_int($key)){
		$sql = " select lounge from g4_lounge_list where lounge_id = $key ";
		$row = sql_fetch($sql);
		$retStr = (urlencode($row['lounge']));
	    header("Location:bbs/board_sellitem.php?bo_table=sellitem&bo_gubun=my_lounge&param_data={$retStr}&param_data2=");
	}
}

//include_once("./_head.php");
include_once("$g4[path]/head.sub.php");
include_once("$g4[path]/lib/outlogin.lib.php");
include_once("$g4[path]/lib/visit.lib.php");
include_once("$g4[path]/lib/connect.lib.php");
include_once("$g4[path]/lib/popular.lib.php");
?>
<script>

$(window).ready(function(){

$("#select_click").click(function(){
 

if($("#select_view").css("display") == "none"){
$("#select_view").css("display" , "block");

}else {
$("#select_view").css("display" , "none");
}


});

$(".svalue").click(function(){
$("#select_view").css("display" , "none");
// 실제로 들어갈 값 
tval  = $(this).attr("tvalue");
ttxt = $(this).html();
$("#find").val(tval);
$("#select_on").html(ttxt);

//$("#view_txt").html( "선택된것은 ["+ ttxt+ "]이며 들어갈 값은 [" + tval+"]"  );

});

});

function goSearch(){
	var f = document.fsearchbox;
	
	if ($("#find").attr("value") == '1'){
		alert ('통합검색은 아직 정의되지 않았음');
		return;
	}else if ($("#find").attr("value") == '2'){ //사고팔기
		f.action = "<?=$g4['bbs_path']?>/board_sellitem.php";
		$("#bo_table").val("sellitem");
		$("#stx").val($("#searchWord").val());
	}else if ($("#find").attr("value") == '3'){ //집구하기
		f.action = "<?=$g4['bbs_path']?>/board_sellhome.php";
		$("#bo_table").val("sellhome");
		$("#stx").val($("#searchWord").val());
	}else if ($("#find").attr("value") == '4'){ //알바구하기
		alert ('준비중입니다.');
		return;
	} 
	
	if ($("#searchWord").val().length < 2) {
        alert("검색어는 두글자 이상 입력하십시오.");
        $("#searchWord").select();
        $("#searchWord").focus();
        return;
    }

	f.submit();
    return;
}

</script>

<style>
li{list-style:none;}
.li_style {list-style:none;}
.svalue{height:24px; padding:8px 0 0 10px; text-align:left;}
.days_count{width:520px; margin:20px auto;height:20px;}
.days_count li{float:left; color:#89a6e3; font-family:Arial; font-weight:bold; font-size:20px; height:20px; line-height:20px;}
.days_count li img{padding-top:7px;}
.number{padding-left:7px;}
</style>
<!-- 메인화면 최신글 시작 -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><table width="860" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="17">&nbsp;</td>
      </tr>
      <tr>
        <td align="right">
        	<? if (!$member['mb_id']) { ?>
        	<!-- 로그인 이전 -->
        	<a href="<?=$g4['bbs_path']?>/login.php?url=<?=$urlencode?>"><img src="img/comm/smenu01.gif" alt="" width="29" height="12" border="0" />
        	</a>
        	<img src="img/comm/smenu_line.gif" width="2" height="12" hspace="7" />
        	<a href="<?=$g4['bbs_path']?>/register.php"><img src="img/comm/smenu_join.gif" width="38" height="12" border="0" />
        	</a>
        	<? } else { ?>
        	<!-- 로그인 이후 -->
        	<a href="<?=$g4['bbs_path']?>/logout.php"><img src="img/comm/smenu01_logout.gif" alt="" width="38" height="11" border="0" />
        	</a>
        	<img src="img/comm/smenu_line.gif" width="2" height="12" hspace="7" />
        	<a href="<?=$g4['bbs_path']?>/member_confirm.php?url=register_form.php"><img src="img/comm/smenu_modify.gif" width="57" height="11" border="0" />
        	</a>
        	<? } ?>
        </td>
      </tr>
      <tr>
        <td height="22">&nbsp;</td>
      </tr>
      <tr>
        <td height="115" align="center" valign="top"><a href="/"><img src="img/comm/logo.gif" width="302" height="71" border="0" /></a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td height="145" align="center" background="img/comm/search_bg.gif">
				<!-- 통합검색 -->
				<div style="position:relative; width:650px; margin:0 auto;">

					<div style="float:left; width:102px; height:32px; border:6px solid #89A6E3; background:#fff; overflow:hidden;" id="select_click">
						<div style="float:left; padding:8px 0 0 10px;" id="select_on"><img src="img/main/search_txt01.gif" alt="" /></div>
						<div style="float:right;"><img src="img/main/search_img.gif" width="27" height="32" border="0" /></div>
					</div>
					<div style="position:absolute; top:38px; width:102px; border:6px solid #89A6E3; background:#fff; z-index:999; display: none;" id="select_view">
						<div class="svalue" tvalue="1"><img src="img/main/search_txt01.gif" alt="" /></div>
						<div class="svalue" tvalue="2"><img src="img/main/search_txt02.gif" alt="" /></div>
						<div class="svalue" tvalue="3"><img src="img/main/search_txt03.gif" alt="" /></div>
						<div class="svalue" tvalue="4"><img src="img/main/search_txt04.gif" alt="" /></div>
					</div>
					<input type="hidden" name="find" value="1" id="find">

					<div style="float:left; width:430px; height:44px;">
						<input type="text" name="searchWord" id="searchWord"  class="box"/>
					</div>
					<div style="float:left; width:92px; height:44px;margin-left:8px;">
						<a href="javascript:goSearch();"><img src="img/comm/bt_search.gif" width="91" height="44" border="0" /></a>
					</div>
				</div>
				<!-- 통합검색 -->
				</td>
			</tr>
		</table>
    </td>
  </tr>
  <tr>
    <td height="188" align="center" valign="top" background="img/comm/gray_bg.jpg"><table width="644" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="48" colspan="3">&nbsp;</td>
        </tr>
      <tr>
        <td><a href="<?=$g4['path']?>/bbs/board_sellitem.php?bo_table=sellitem"><img src="img/comm/banner01.jpg" width="210" height="130" border="0" /></a></td>
        <td><a href="<?=$g4['path']?>/bbs/board_sellhome.php?bo_table=sellhome"><img src="img/comm/banner02.jpg" width="210" height="130" border="0" /></a></td>
        <td><a href="#"><img src="img/comm/banner03.jpg" width="210" height="130" border="0" /></a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="center"><table width="644" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="65">&nbsp;</td>
      </tr>
      <tr>
        <td align="center"><a href="<?=$g4['bbs_path']?>/register.php"><img src="img/main/bt_join.gif" width="188" height="25" border="0" /></a></td>
      </tr>
      <tr>
        <td height="34">&nbsp;</td>
      </tr>
      <tr>
        <td align="center"><img src="img/main/txt_01.gif" width="209" height="14" /></td>
      </tr>
      <tr>
        <td height="15"></td>
      </tr>
      <tr>
        <td align="center">
			<div class="font-size:10px; color:#a9a9a9;">
<?
$SQL =    "SELECT count(1) member_cnt ";
$SQL .= "  FROM g4_member a          ";

$row_member = sql_fetch($SQL);

$SQL =    "SELECT sum(s_cnt) s_cnt            ";
$SQL .= "  FROM                             ";
$SQL .= "       (SELECT count(1) s_cnt      ";
$SQL .= "         FROM g4_write_sellitem a ";
$SQL .= "        WHERE a.wr_is_comment = 0 ";
$SQL .= "           UNION ALL               ";
$SQL .= "       SELECT count(1) s_cnt       ";
$SQL .= "         FROM g4_write_buyitem a   ";
$SQL .= "        WHERE a.wr_is_comment = 0 ";
$SQL .= "           UNION ALL               ";
$SQL .= "       SELECT count(1) s_cnt       ";
$SQL .= "         FROM g4_write_sellhome a ";
$SQL .= "        WHERE a.wr_is_comment = 0 ";
$SQL .= "           UNION ALL               ";
$SQL .= "       SELECT count(1) s_cnt       ";
$SQL .= "         FROM g4_write_buyhome a   ";
$SQL .= "        WHERE a.wr_is_comment = 0 ";
$SQL .= "       ) a                         ";
		
$row_story = sql_fetch($SQL);
?>
				<strong>2011년 7월 22일부터 <span style="font-size:23px; color:#89a6e3;"><?=number_format($row_member['member_cnt'])?></span>명이 <span style="font-size:23px; color:#89a6e3;"><?=number_format($row_story['s_cnt'])?></span>개의 이야기를 나누고 있습니다.</span></strong>
			</div>
		</td>
      </tr>
      <tr>
        <td height="40">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
<!-- 메인화면 최신글 끝 -->
<form name="fsearchbox" method="get" style="margin:0px;">
	<input type="hidden" name="sfl" id="sfl" value="wr_content||wr_name||wr_10||itemBrand||itemName"/>
    <input type="hidden" name="sop" value="and"/>
    <input type="hidden" name="bo_table" id="bo_table" value=""/>
	<input type="hidden" name="stx" id="stx" type="text" class="box5" id="stx" value="" />
</form>

<?
//include_once("./_tail.php");
?>
